package com.ruoyi.h5.controller;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.MiniUser;
import com.ruoyi.system.domain.vo.h5.IncomeSummaryVO;
import com.ruoyi.system.service.MiniUserService;
import com.ruoyi.system.service.h5.IMyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 我的界面
 */
@RestController
@RequestMapping("/my")
@Slf4j
@Anonymous
public class MyController {
    @Autowired
    private IMyService myService;
    /**
     * 我的推广收益汇总
     * @return
     */
    @GetMapping("incomeSummary")
    public AjaxResult<IncomeSummaryVO> incomeSummary(@RequestParam String openid){
        return myService.incomeSummary(openid);
    }
    /**
     * 我的邀请记录
     * @return
     */
    @GetMapping("inviteRecord")
    public AjaxResult<List<IncomeSummaryVO>> inviteRecord(@RequestParam String openid){
        return myService.inviteRecord(openid);
    }
    /**
     * 我的信息
     * @return
     */
    @GetMapping("myInfo")
    public AjaxResult<MiniUser> myInfo(@RequestParam String openid){
        return myService.myInfo(openid);
    }
}
